<template>
  <div>
    <button @click="isShow = !isShow">显示/隐藏</button>
    <transition appear>
      <h1 v-show="isShow">Hello World!</h1>
    </transition>

  </div>
</template>

<script>
export default {
  name: "ShowHide",
  data(){
    return {
      isShow:true
    }
  }
}
</script>

<style scoped>
h1{
  background-color: orange;
}
.come{
  animation: animation0 1s;
}
.go{
  animation: animation0 1s reverse;
}

.v-enter-active{
  animation: animation0 1s;
}
.v-leave-action{
  animation: animation0 1s reverse;
}


@keyframes animation0 {
  from{
    transform: translateX(-100%);
  }
  to{
    transform: translateX(0px);
  }
}

</style>
